package uestc.lj.gulishop.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import uestc.lj.common.to.SeckillOrderTO;
import uestc.lj.common.utils.PageUtils;
import uestc.lj.gulishop.order.entity.OrderEntity;
import uestc.lj.gulishop.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author crazlee
 * @email peterlee0@163.com
 * @date 2021-05-21 19:25:52
 */
public interface OrderService extends IService<OrderEntity> {

    /**
     * 展示登录用户的订单数据
     *
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 返回订单实体类
     *
     * @return
     */
    OrderConfirmVO confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单操作
     *
     * @param orderSubmitVO
     * @return
     */
    submitOrderResponseVO submitOrder(OrderSubmitVO orderSubmitVO);

    /**
     * 根据订单号查询订单
     *
     * @param orderSn
     * @return
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    /**
     * 关闭订单
     *
     * @param orderEntity
     */
    void closeOrder(OrderEntity orderEntity);

    /**
     * 根据订单号获取当前订单支付信息
     *
     * @param orderSn
     * @return
     */
    PayVo getPayOrder(String orderSn);

    /**
     * 处理支付宝的支付结果
     *
     * @param payAsyncVo
     * @return
     */
    String handlePayResult(PayAsyncVo payAsyncVo);

    /**
     * 创建秒杀单的详细信息
     * @param seckillOrderTO
     */
    void createSeckillOrder(SeckillOrderTO seckillOrderTO) throws ExecutionException, InterruptedException;

}

